<!DOCTYPE html>
<html>

<head>
    <title>render函数示例</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <anchored-heading v-bind:level="2">你好</anchored-heading>
    </div>
    <script>
    Vue.component('anchored-heading', {
        render: function(createElement) {
        	return createElement('h' + this.level, this.$slots.default)
        },
        props: {
            level: {
                type: Number,
                required: true
            }
        }
    })
    new Vue({
        el: "#app"
    })
    </script>
</body>

</html>
